package entity

import (
	"shqsoft.cn/pasnj/base"
)

//TIndiClie 用户
type UserWorkStep struct {
	ID           int     `gorm:"AUTO_INCREMENT;primary_key;column:ID"`
	DDID         int     `gorm:"column:DDID"`
	EMID         int     `gorm:"column:EMID"`
	STATE        int     `gorm:"column:STATE"`
	STATECaption string  `gorm:"-"`
	DES          *string `gorm:"DES"`
	STEP         int     `gorm:"STEP"`
}

//TableName User用户表名
func (UserWorkStep) TableName() string {
	return "T_SysUser_YGDD_STEP"
}
func (u *UserWorkStep) AfterFind() (err error) {
	if u.STATE == -1 {
		u.STATECaption = "退回"
	} else if u.STATE == 1 {
		u.STATECaption = "处理完成"
	} else if u.STATE == 2 {
		u.STATECaption = "已提交"
	}
	return
}

func UserWorkStepEF() base.EntityFunc {
	return func() interface{} {
		entity := UserWorkStep{}
		return &entity
	}
}
func UserWorkStepESF() base.EntitiesFunc {
	return func() interface{} {
		var entities []UserWorkStep
		return &entities
	}
}

func init() {
	base.DaoPoolObj.Put("UserWorkStep", base.NewDefaultDao(UserWorkStepEF(), UserWorkStepESF(), nil))
}
